<?php
namespace Admin\Controller;
use Think\Controller;
class NoticeController extends Controller {
	public function index(){
		$notice = D('Notice');
		$list = $notice->order('id desc')->select();
		$this->assign("list",$list);
		$this->display();
	}
	public function showlist(){
		$notice = D('Notice');
		$list = $notice->order('id desc')->select();
		$this->assign("list",$list);
		$this->display();
	}
	public function add(){
		$notice = D('Notice');
		$data = $notice->create($_POST);
		if($data){
			$result = $notice->add($data);
			if($result){
				$this->success("添加成功!","index");
			}else{
				$this->error("添加失败!");
			}
		}
	}
}